/**
 * Project Name:emm-data-api
 * File Name:ContactWayUtils.java
 * Package Name:com.emm.yixun.openapi.utils
 * Date:2017年7月27日下午3:45:07
 * Copyright (c) 2017, chenzhou1025@126.com All Rights Reserved.
 *
*/

package com.emm.yixun.website.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.emm.yixun.common.utils.DateStyle;
import com.emm.yixun.common.utils.DateUtils;

/**
 * ClassName:ContactWayUtils <br/>
 * @author   Administrator
 * @version  
 * @since    JDK 1.6
 * @see 	 
 */
public class ContactWayUtils {

    public static Map<String, String> getDate(String index){
	Map<String, String> map = new HashMap<String, String>();
	SimpleDateFormat df = new SimpleDateFormat(DateStyle.YYYY_MM_DD.getValue());
	String createStartDate= "";
	try {
	    if("1".equals(index)){ //当天
		 createStartDate = df.format(new Date())+" 00:00:00";
	    }else if("2".equals(index)){ //本周
		 createStartDate=DateUtils.formatDate(DateUtils.getWeekStartDate(), DateStyle.YYYY_MM_DD_HH_MM_SS.getValue());
	    }else if("3".equals(index)){ //本月
		createStartDate =DateUtils.formatDate(DateUtils.getMonthStartDate(), DateStyle.YYYY_MM_DD_HH_MM_SS.getValue()); 
	    }else if("4".equals(index)){ //本年
		createStartDate =DateUtils.formatDate(DateUtils.getCurrYearFirst(), DateStyle.YYYY_MM_DD_HH_MM_SS.getValue()); 
	    }
	    map.put("createStartDate", createStartDate);
	    map.put("endDate", DateUtils.formatDate(new Date(), DateStyle.YYYY_MM_DD_HH_MM_SS.getValue()));
	} catch (Exception e) {
	    return map;
	}
	return map;
	
    }
}

